<template>
  <div class="branch-management">
    <!-- 头部操作栏 -->
    <div class="header">
      <h2>分行管理</h2>
      <div class="actions">
        <el-button type="primary" @click="openDialog">+ 新建</el-button>
        <div class="icons">
          <i class="icon-c">C</i>
          <i class="icon-i">I</i>
          <el-icon :size="20"><Setting /></el-icon>
        </div>
      </div>
    </div>

    <!-- 数据表格 -->
    <el-table :data="tableData" style="width: 100%" empty-text="暂无数据">
      <el-table-column prop="index" label="序号" width="80" />
      <el-table-column prop="shortName" label="分行简称" />
      <el-table-column prop="fullName" label="分行全称" />
      <el-table-column label="分行 logo">
        <template #default="{ row }">
          <img v-if="row.logo" :src="row.logo" class="logo" />
        </template>
      </el-table-column>
      <el-table-column prop="industry" label="所属行业" />
      <el-table-column prop="nature" label="分行性质" />
      <el-table-column label="操作" width="120">
        <template #default>
          <el-button link type="primary">编辑</el-button>
          <el-button link type="danger">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <div class="pagination">
      <el-pagination
          :current-page="currentPage"
          :page-size="pageSize"
          layout="prev, pager, next"
          :total="total"
      />
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { Setting } from '@element-plus/icons-vue'

// 表格数据（示例）
const tableData = ref([])
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(0)

const openDialog = () => {
  // 打开新建弹窗逻辑
}
</script>

<style scoped>
.branch-management {
  background: white;
  padding: 20px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icons {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #666;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.el-table {
  --el-table-border-color: #f0f0f0;
  --el-table-header-bg-color: #fafafa;
}
</style>